package com.zhb.parse;

import com.zhb.beans.Message;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import java.util.ArrayList;
import java.util.List;

/**
 * @program: XianYvTest
 * @description:
 * @author: rainboz
 * @create: 2019-09-20 14:14
 **/
public class MessageParse {
    public static List<Message> getData(String entity) {
        //获取的数据，存放在集合中
        List<Message> data = new ArrayList<Message>();
        //采用Jsoup解析
        Document doc = Jsoup.parse(entity);

        //获取html标签中的内容
        String elm = doc.select("span").text();
        System.out.println("-------------"+elm);

        Message message = new Message();
        message.setContent(elm);
        message.setName(elm);
        message.setTime(elm);

        return data;
    }
}
